package com.zifeng.study.service.impl;

import com.zifeng.study.bean.User;
import com.zifeng.study.service.OrderService;
import com.zifeng.study.service.UserService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

/**
 * @author 吴梓锋
 * @version 1.0.0
 * @date 2022/06/05 17:02:17
 * @description 订单service实现类
 */
@Service
public class OrderServiceImpl implements OrderService {

    @DubboReference(version = "${demo.service.version}")
    UserService userService;

    @Override
    public String createOrder(long userId, String product) {
        User user = userService.getUserById(userId);
        return "用户【" + user.getUserName() + "】创建【" + product + "】购买订单成功！";
    }

}
